<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>JS for测试</title>

    <script>

        const arr = ['apple', 'banana', 'pear', 'orange']


        for(let k in arr){
            console.log(k);
        }

        const keys = Object.keys(arr);
        for(let i=0; i < keys.length; i++){
            const k = keys[i];
            console.log(k)
        }


    </script>
</head>

<body>

</body>

</html>